import javaBaseUrl, {
    tokenKey
} from '../javaBaseUrl'
import {
    createService
} from '@utils/request'
const request = createService(javaBaseUrl, tokenKey)


//获取组织数据懒加载接口
export const getOrgLazy = (data) => {
    return request.get(`/permission/dept/lazy?pid=${data}`)
}
//根据登录用户获取组织数据接口
export const getOrgAll = (data) => {
    return request.get(`permission/dept/build`,{params:data})
}

//统计——>排名页面
//查看个人整年绩效（折线图弹窗年度数据）
export const getStatisticPerson = (data) => {
    return request.get(`/statistic/person/${data.uid}/${data.year}`)
}
//查看排名（右边表格数据）
export const getStatisticShoworder = (data) => {
    return request.get(`/statistic/showorder?${data.month?'month='+data.month:''}${data.orgid?'&orgId='+data.orgid:''}`)
}

//绩效——>季度绩效
//季度绩效列表
export const getStatisticQuarter = (data) => {
    return request.get(`/statistic/quarter?${data.year?'year='+data.year:''}${data.orgid?'&orgId='+data.orgid:''}`)
}

//绩效——>年度绩效
//年度绩效列表
export const getStatisticAnnual = (data) => {
    return request.get(`/statistic/annual?${data.year?'year='+data.year:''}${data.orgid?'&orgId='+data.orgid:''}`)
}
//年度绩效详情（查看个人绩效）
export const getStatisticQuarterPerson = (data) => {
    return request.get(`/statistic/quarter/person?${data.year?'year='+data.year:''}${data.uid?'&uid='+data.uid:''}`)
}

//绩效——>考核单生成
//一键锁定后生成数据接口
export const getStatisticGenerateQyScore = (data) => {
    return request.get(`/statistic/generate_qy_score/${data}`)
}

//绩效——>绩效管理——>质量考核管理
//质量考核管理页面右边table数据列表
export const getAppraiseQualityAdditionScore = (data) => {
    return request.get(`/appraise/quality/addition/score?pageSize=${data.pagesize}&pageNo=${data.pageno}`)
}
//质量考核管理页面弹窗新增保存
export const getAppraiseQualityAddition = (data) => {
    return request.post(`/appraise/quality/addition/`, data)
}
//质量考核管理页面弹窗中考核点下拉框的数据（考核点classId=2为质量考核点）
export const getAppraiseQualitySpot = () => {
    return request.get(`/appraise/spot?pageSize=1000&pageNo=1&classId=2&pid=0`)
}
//质量考核管理页面弹窗中人员下拉框的数据
export const getUsers = (data) => {
    return request.get(`/user`,{params:data})
}

//绩效——>我的绩效
//列表数据
export const getStatisticPersonQy = (data) => {
    return request.get(`/statistic/person/qy?date=${data}`)
}

export default {
    getOrgLazy,
    getOrgAll,
    getStatisticPerson,
    getStatisticShoworder,
    getStatisticQuarter,
    getStatisticAnnual,
    getStatisticQuarterPerson,
    getStatisticGenerateQyScore,
    getAppraiseQualityAdditionScore,
    getAppraiseQualityAddition,
    getAppraiseQualitySpot,
    getUsers,
    getStatisticPersonQy,
}